<?php
namespace app\store\controller;
use app\store\model\Signup as SignupModel;
/**
 *
 * Class Signup
 * @package app\store\controller
 */
class Signup extends Controller{

    public function index(){
        $model = new SignupModel;
        $list = $model->getList($this->request->param());
        return $this->fetch('index', compact('list'));
    }

    /**
     * 报名详情
     * @param $id
     * @return array|mixed
     * @throws \think\exception\DbException
     */
    public function detail($id)
    {
        // 评价详情
        $model = SignupModel::detail($id);
        if (!$this->request->isAjax()) {
            return $this->fetch('detail', compact('model'));
        }

    }

    /**
     * 删除报名
     * @param $signup_id
     * @return array
     * @throws \think\exception\DbException
     */
    public function delete($signup_id)
    {
        $model = SignupModel::get($signup_id);
        if (!$model->delete()) {
            return $this->renderError('删除失败');
        }
        return $this->renderSuccess('删除成功');
    }
}